﻿using ClassLab;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace OOPapl
{
    class Program
    {
        static void Main(string[] args)
		  
        {
            Tree[] forest = new Tree[5];
            Weather[] weath = new Weather[5];
            GenerateForest(forest);
            GenerateWeather(weath);
            PrintWeatherInfo(weath);
            PrintTreeInfo(forest);
            Console.ReadKey();
        }
        public static void GenerateForest(Tree[] forest)
        {
            Random seed = new Random();
            for (Int32 i = 0; i < forest.Length; i++)
            {
                Thread.Sleep(seed.Next(0, 100));
                forest[i]=new Tree((ushort)seed.Next(0,10));
            }
        }
        static void PrintTreeInfo(Tree[] forest)
        {
            Console.WriteLine("{0} - Number of trees",Tree.countTree);
            Console.WriteLine("id \t hight \t age \t");
            for (Int32 i = 0; i < forest.Length; i++)
            {
                Console.WriteLine("{0} \t {1} \t{2} \t{3}", forest[i].id,forest[i].hight,forest[i].age, forest[i].poroda);
            }
        }
        public static void GenerateWeather(Weather[] weath)
        {
            Random seed = new Random();
            for (Int32 i = 0; i < weath.Length; i++)
            {
                weath[i] = new Weather((ushort)seed.Next(0, 10));
            }
        }
        static void PrintWeatherInfo(Weather[] weath)
        {
            for (Int32 i = 0; i < weath.Length; i++)
            {
                Console.WriteLine("{0} C \t{1}", weath[i].temperature,weath[i].time);
            }
        }
    }
}
